package oop.day02;

public class TestExte {
    public static void main(String[] args) {
        Person person = new Person("李大大",30,"黑龙江");
        person.eat();
        person.sleep();
        person.sayHi();

        //person.clazzname="";
       // person.study(); 父类是不能使用子类的属性和方法的

        Student student = new Student();
        student.name="张三";// 继承下的属性
        student.age=21;
        student.address="北京";
        student.clazzName="ibm";// 自己特有属性
        student.stuId="20050123";
        System.out.println(student.name);
        student.eat();// 父类继承下的方法
        student.sleep();
        student.sayHi();

        student.study();//自己特有的方法

        Doctor doctor = new Doctor();
        doctor.name="王医生";
        doctor.age=21;
        doctor.title="高级麻醉师";
        doctor.sayHi();
        doctor.eat();
        doctor.sleep();
        doctor.cut();

        //演示传递性
        SmallStudent smallStudent = new SmallStudent();
        smallStudent.name="小明";
        smallStudent.stuId="112";
        smallStudent.eat();
        smallStudent.study();

        Student s1= new Student
                ("小白",12,"山东","java1","20250112");
        System.out.println(s1.name);
        System.out.println(s1.age);
        System.out.println(s1.address);
        System.out.println(s1.clazzName);
        System.out.println(s1.stuId);


    }
}
